home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / BK-SC1_1.DMS / in.adf / Examples.Lha / shared lib example / test.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-25  |  451 b   |  25 lines

  1.  
  2. #include <exec/libraries.h>
  3. #include <pragma/exec_lib.h>
  4. #include <stdio.h>
  5.  
  6. #include "lib.h"
  7. #include "lib_protos.h"
  8. #include "test.h"
  9.  
  10. struct LibBase *TestBase;
  11.  
  12. void main()
  13. {
  14.     if (TestBase = (struct LibBase *) OpenLibrary("test.library",1))
  15.     {
  16.         printf("1 + 2 = %ld\n",AddTwo(1,2));
  17.         printf("last_result = %ld\n",TestBase->last_result);
  18.         CloseLibrary((struct Library *) TestBase);
  19.     }
  20.     else
  21.     {
  22.         printf("unable to open \"test.library\".");
  23.     };
  24. }
  25.